package zzz.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import zzz.mapper.CompanyMapper;
import zzz.model.Company;
import zzz.service.CompanyService;

@Service
@Transactional
public class CompanyServiceImpl implements CompanyService{

	@Autowired
	private CompanyMapper mapper;
	@Override
	public List<Company> getAllCompanys() {
		// TODO Auto-generated method stub
		return mapper.getAllCompanys();
	}
	@Override
	public void delCompany(String ecId) {
		// TODO Auto-generated method stub
		System.out.println("ecId:"+ecId);
		mapper.delCompany(ecId);
	}
	@Override
	public Company getCompanyByEcId(String ecId) {
		// TODO Auto-generated method stub
		System.out.println("service+ecId:"+ecId);
		return mapper.getCompanyByEcId(ecId);
	}

	@Override
	public void updateCompany(Company company) {
		// TODO Auto-generated method stub
		mapper.updateCompany(company);
	}

	@Override
	public int addCompany(Company company) {
		// TODO Auto-generated method stub
		int i=mapper.manageAddCompany(company);
		return i;
	}
}
